/*
*    Phantom v2.0 GUI Automation Software
*    Copyright (C) 2009  John C. Van Arsdall (john@phantomtest.com)
*
*    This program is free software; you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation; either version 2 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License along
*    with this program; if not, write to the Free Software Foundation, Inc.,
*    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
// Input.h: interface for the CInput class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_INPUT_H__DFB56833_5874_4BCF_83BB_48F13960A48A__INCLUDED_)
#define AFX_INPUT_H__DFB56833_5874_4BCF_83BB_48F13960A48A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ssi_defines.h"
#include "ssi_string.h"
#include "ssi_scriptline.h"
#include "ssi_dataint.h"
#include "ssi_flowstruct.h"
#include "ssi_scriptstatement.h"
#include "ssi_debugger.h"

class SSI_SCRIPTDLL_API CInput  
{
public:
	String GetInputName();
	String GetFileName();
	ScriptNode* GetCurrLine();
	void SetCurrLine(ScriptNode* NewCurr);
	SSI_BOOL PopPointer(CFlowStruct& Ret);
  void PushPointer(CFlowStruct &New);

private: 
	ScriptTree Lines;
  
public:
  CInput();
	virtual ~CInput();
  virtual SSI_BOOL GetNextLine(CScriptLine& Ret) = 0;
  virtual SSI_INT64 Query(const CScriptStatement& aStatement);

protected:
	void SetInputName(const String& Name);
	ScriptNode* CurrLine;

public:
	void SetFileName(const String& Name);

private:
  String InpName;
	String FileName;
  FlowTree Flows;

public:
	SSI_INT64 RunMode;
	ScriptNode* PushLine(CScriptLine& NewLine);
	void ClearLines(void);
	ScriptNode* GetTopLine(void);
	ScriptNode* GetByID(SSI_INT64 ID);
	CDebugger* Debugger;
};

SSI_INT64 GetUniqueLineID();

#endif // !defined(AFX_INPUT_H__DFB56833_5874_4BCF_83BB_48F13960A48A__INCLUDED_)



